package com.hzw.code.config.property;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * swagger参数
 */
@Component
@ConfigurationProperties(prefix = "app.swagger")
@Data
public class SwaggerProperty {

	/**
	 * 是否启用swagger，正式环境关闭
	 */
	private Boolean enabled;

	/**
	 * 设置tokenkey，无则不设置（为后面做无状态访问作准备）
	 */
	private String tokenKey;

	private String baseUrl;

	private String title;

	private String description;

	private String termsOfServiceUrl;

	private String authorName;

	private String authorUrl;

	private String authorEmail;

	private String version;

	/**
	 * 扫描包位置，不配置则默认为com
	 */
	private String basePackage;

	public String getBasePackage() {
		return StringUtils.isNoneBlank(basePackage) ? basePackage : "com";
	}
}
